import Vue from 'vue'
import App from '@/App'
import './pash/index.css'
import '@/element-ui'   // api: https://github.com/ElemeFE/element
// import './pash/element-icons.ttf'
// import './pash/element-icons.woff'

import router from '@/router'                 // api: https://github.com/vuejs/vue-router
import store from '@/store'                   // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie'            // api: https://github.com/alfhen/vue-cookie
import '@/icons'                              // api: http://www.iconfont.cn/
// import '@/element-ui-theme'
import '@/assets/scss/index.scss'
import '@/assets/iconfont/iconfont.css'
import '@/assets/iconfont/iconfont.js'
import '@/assets/iconfonts/iconfont.css'
import '@/assets/iconfonts/iconfont.js'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import { isAuth } from '@/utils'
import '@/utils/utils'
import cloneDeep from 'lodash/cloneDeep'
import VCharts from 'v-charts'
import Vue2OrgTree from 'vue2-org-tree'
import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
// import Print from 'vue-print-nb'
import Print from '@/components/print/print.js'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import '@/style/index.scss'
// import  HappyScroll  from 'vue-happy-scroll'
// import 'vue-happy-scroll/docs/happy-scroll.css'
Vue.use(VueQuillEditor)
// Vue.component('happy-scroll', HappyScroll)
Vue.use(Print) // 注册
// 全局 (推荐)
/* import EleImage from 'vue-ele-image'
// 可以配置全局默认值(配置中每一项都是可选)
Vue.use(EleImage, {
  fit: 'cover',
  lazy: true,
  color: '#fff',
  defaultSrc: 'https://dwz.cn/QYY2qkts',
  backgroundColor: '#409EFF'
}) */

Vue.use(VueCookie)
Vue.config.productionTip = false
Vue.use(VCharts)
Vue.use(Vue2OrgTree)
Vue.use(Viewer)
Viewer.setDefaults({
  Options: {
    'inline': true,  // 启用 inline 模式 默认false
    'button': true,　　// 显示右上角关闭按钮 默认true
    'navbar': true,　　// 显示缩略图导航 默认true
    'title': true,　// 显示当前图片的标题 默认true
    'toolbar': true,　　// 显示工具栏 默认true
    'tooltip': true,　　// 显示缩放百分比 默认true
    'movable': true,　　// 图片是否可移动 默认true
    'zoomable': true,　　// 图片是否可缩放 默认true
    'rotatable': true,　　// 图片是否可旋转 默认true
    'scalable': true,　　// 图片是否可翻转 默认true
    'transition': true,　　// 使用css3过度 默认true
    'fullscreen': true,　　// 是否全屏 默认true
    'keyboard': true,　　// 是否支持键盘 默认true
    'url': 'data-source' // 设置大图片的URL
  }
})
// Vue.use(Print);

import '@/utils/dialogDrag'

// 非生产环境, 适配mockjs模拟数据                 // api: https://github.com/nuysoft/Mock
if (process.env.NODE_ENV !== 'production') {
  require('@/mock')
}

// 挂载全局
Vue.prototype.$http = httpRequest // ajax请求方法
Vue.prototype.isAuth = isAuth     // 权限方法

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
